<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>学生管理</title>
</head>
<body class="hold-transition skin-black sidebar-mini">
<div th:replace="common/fragment :: link"></div>
<div class="wrapper">
    <div th:replace="common/fragment :: navbar"></div>
    <div th:replace="common/fragment :: menu"></div>
    <div class="content-wrapper">
        <section class="content-header">
            <h1>学生管理</h1>
        </section>
        <section class="content">
            <div class="box">
                <!--高级查询--->
                <div style="margin: 10px;">
                    <form class="form-inline" id="searchForm" action="/student/list" method="post">
                        <input type="hidden" name="currentPage" id="currentPage" value="1">
                        <div class="form-group">
                            <label for="keyword">关键字:</label>
                            <input type="text" class="form-control" id="keyword" name="keyword"
                                   th:value="${qo?.keyword}" placeholder="请输入姓名/邮箱">
                        </div>
                        <div class="form-group">
                            年龄范围: <input type="text" name="minAge" th:value="${qo?.minAge}">
                            -- <input type="text" name="maxAge" th:value="${qo?.maxAge}">
                            </select>
                        </div>
                        <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span>
                            查询
                        </button>
                        <a href="/student/input" class="btn btn-success btn-input">
                            <span class="glyphicon glyphicon-plus"></span> 添加
                        </a>
                    </form>
                </div>
                <div class="box-body table-responsive ">
                    <table class="table table-hover table-bordered table-striped">
                        <thead>
                        <tr>
                            <th><input type="checkbox" id="allCb"></th>
                            <th>编号</th>
                            <th>用户名</th>
                            <th>姓名</th>
                            <th>年龄</th>
                            <th>宿舍</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="student,stat:${pageInfo?.list}">
                            <td><input type="checkbox" class="cb"></td>
                            <td th:text="${stat?.count}">1</td>
                            <td th:text="${student?.username}">zs</td>
                            <td th:text="${student?.name}">张三</td>
                            <td th:text="${student?.age}">18</td>
                            <td th:text="${student?.room?.room_id}">21</td>
                            <td>
                                <a class="btn btn-info btn-xs btn_redirect"  th:href="|/student/input?id=${student?.id}|">
                                    <span class="glyphicon glyphicon-pencil"></span> 编辑
                                </a>
                                <a class="btn btn-danger btn-xs btn-delete" th:data-url="|/student/delete?id=${student?.id}|">
                                    <span class="glyphicon glyphicon-trash"></span> 删除
                                </a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div th:replace="common/fragment :: page"></div>
                </div>
            </div>
        </section>
    </div>
    <div th:replace="common/fragment :: footer"></div>
</div>
</body>
</html>